﻿using CarAppDomain.CarParts.Entities;
using CarAppDomain.CarType.Entities;
using CarAppDto.CarParts.CarPartsDtos;
using D.UtilSqlsugarOrm;
using Microsoft.AspNetCore.Mvc.RazorPages;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CarAppDomain.CarParts.IRepository
{
    public interface ICarPartsEntityRepository : IBaseRepository<CarPartsEntity>
    {
        /// <summary>
        /// 通过车系Id，查询配件信息
        /// </summary>
        /// <param name="carTpye"></param>
        /// <returns></returns>
         Task<List<RepCarParts>> GetCarPartsListByVehicleSeries(int pageSize, int current, string vehicleSeries);

        /// <summary>
        /// 通过车型Id，查询配件信息
        /// </summary>
        /// <param name="carTpye"></param>
        /// <returns></returns>
        Task<List<RepCarPartsCarTypeVersion>> GetCarPartsCarType( string carTpye);

        /// <summary>
        /// 通过车型版本Id，查询配件信息
        /// </summary>
        /// <param name="carTpye"></param>
        /// <returns></returns>
        Task<List<RepCarPartsCarTypeVersion>> GetCarPartsCarTypeVersion(string carTpyeVersion);

        /// <summary>
        /// 获取配件详情
        /// </summary>
        /// <param name="where"></param>
        /// <param name="order"></param>
        /// <returns></returns>
        Task<List<RepCarParts>> GetListAsync(System.Linq.Expressions.Expression<Func<CarPartsEntity, bool>> where = null, System.Linq.Expressions.Expression<Func<CarPartsEntity, object>> order = null);

        //分页查询
        /// <summary>
        /// 分页查询 加入条件
        /// </summary>
        /// <param name="pageSize">每页显示多少条</param>
        /// <param name="current">当前第几页</param>
        /// <param name="where"></param>
        /// <param name="order"></param>
        /// <returns></returns>
        Task<PageModel<RepCarParts>> GetPagesAsync(int pageSize, int current, System.Linq.Expressions.Expression<Func<CarPartsEntity, bool>> where, System.Linq.Expressions.Expression<Func<CarPartsEntity, object>> order = null);

        /// <summary>
        ///  获取车型的全部配件
        /// </summary>
        /// <param name="vehicleSeries"></param>
        /// <param name="carTpyeId"></param>
        /// <returns></returns>
        Task<List<RepCarParts>> GetCarPartsByCarTypeId(string vehicleSeries, string carTpyeId);
    }
}
